package org.example.product.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@Configuration
public class CodeGenerator {
    private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
    @Bean
    public static String generateId() {
        return formatter.format(LocalDateTime.now()) + System.currentTimeMillis() % 10000;
    }
}
